﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="print_printhjg.aspx.cs" Inherits="NetWing.BPM.Admin.JydWodrmb.print_printhjg" %>

<!DOCTYPE html>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Sql" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<%@ Import Namespace="NetWing.Common" %>
<%@ Import Namespace="NetWing.Common.Data" %>
<%@ Import Namespace="NetWing.Common.Data.SqlServer" %>
<%@ Import Namespace="NetWing.Common.Provider" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>聚源达后加工单</title>
    <meta content="" name="keywords">
    <meta content="" name="description">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <script type="text/javascript" src="../scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../scripts/lhgdialog/lhgdialog.js?skin=idialog"></script>
    <link type="text/css" rel="stylesheet" href="css/base.css" />
    <style>
        .hhh{
            width:80px;
            height:80px;
            margin-top:20px;
        }
    </style>
    <script>
        //窗口API
        var api = frameElement.api, W = api.opener;
        var myDate = new Date();
        api.button(
            {
                name: '确认打印',
                focus: true,
                callback: function () {
                    printWin();
                    return false;
                }
            },
            //{
            //    name: '导出Excel',
            //    callback: function () {
            //        ajaxExcel();
            //        return false;
            //    }
            //},
            {
                name: '取消'
            }
        );

        //打印方法
        function printWin() {
            var oWin = window.open("", "_blank");
            oWin.document.write(document.getElementById("print_content").innerHTML);
            oWin.focus();
            oWin.document.close();
            oWin.print()
            oWin.close()
        }





        //小写转大写
function cmycurd(num) {  //转成人民币大写金额形式
	var str1 = '零壹贰叁肆伍陆柒捌玖';  //0-9所对应的汉字
	var str2 = '万仟佰拾亿仟佰拾万仟佰拾元角分'; //数字位所对应的汉字
	var str3;    //从原num值中取出的值
	var str4;    //数字的字符串形式
	var str5 = '';  //人民币大写金额形式
	var i;    //循环变量
	var j;    //num的值乘以100的字符串长度
	var ch1;    //数字的汉语读法
	var ch2;    //数字位的汉字读法
	var nzero = 0;  //用来计算连续的零值是几个

	num = Math.abs(num).toFixed(2);  //将num取绝对值并四舍五入取2位小数
	str4 = (num * 100).toFixed(0).toString();  //将num乘100并转换成字符串形式
	j = str4.length;      //找出最高位
	if (j > 15) { return '溢出'; }
	str2 = str2.substr(15 - j);    //取出对应位数的str2的值。如：200.55,j为5所以str2=佰拾元角分

	//循环取出每一位需要转换的值
	for (i = 0; i < j; i++) {
		str3 = str4.substr(i, 1);   //取出需转换的某一位的值
		if (i != (j - 3) && i != (j - 7) && i != (j - 11) && i != (j - 15)) {    //当所取位数不为元、万、亿、万亿上的数字时
			if (str3 == '0') {
				ch1 = '';
				ch2 = '';
				nzero = nzero + 1;
			}
			else {
				if (str3 != '0' && nzero != 0) {
					ch1 = '零' + str1.substr(str3 * 1, 1);
					ch2 = str2.substr(i, 1);
					nzero = 0;
				}
				else {
					ch1 = str1.substr(str3 * 1, 1);
					ch2 = str2.substr(i, 1);
					nzero = 0;
				}
			}
		}
		else { //该位是万亿，亿，万，元位等关键位
			if (str3 != '0' && nzero != 0) {
				ch1 = "零" + str1.substr(str3 * 1, 1);
				ch2 = str2.substr(i, 1);
				nzero = 0;
			}
			else {
				if (str3 != '0' && nzero == 0) {
					ch1 = str1.substr(str3 * 1, 1);
					ch2 = str2.substr(i, 1);
					nzero = 0;
				}
				else {
					if (str3 == '0' && nzero >= 3) {
						ch1 = '';
						ch2 = '';
						nzero = nzero + 1;
					}
					else {
						if (j >= 11) {
							ch1 = '';
							nzero = nzero + 1;
						}
						else {
							ch1 = '';
							ch2 = str2.substr(i, 1);
							nzero = nzero + 1;
						}
					}
				}
			}
		}
		if (i == (j - 11) || i == (j - 3)) {  //如果该位是亿位或元位，则必须写上
			ch2 = str2.substr(i, 1);
		}
		str5 = str5 + ch1 + ch2;

		if (i == j - 1 && str3 == '0') {   //最后一位（分）为0时，加上"整"
			str5 = str5 + '整';
		}
	}
	if (num == 0) {
		str5 = '零元整';
	}
	return str5;
}
//小写转大写

    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div id="print_content">
             <!--全局变量-->
              <table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tr>
			<td align="left" valign="top">
			<table cellspacing="0" cellpadding="0" width="100%" border="0">

                        <tr>
                            <td height="11" align="left">
            <!--接件单名-->
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			
            <p class="MsoNormal" style="text-align:center;margin:0 auto;">
                <img width="61" height="34" src="/JydWodrmb/img/dyt.png"  style="text-align:center;"><b style="font-size:24px;font-family: 微软雅黑;height:30px; line-height:30px;margin:4px 0 0 0; ">昆明聚源达彩印包装有限公司发外加工单</span></span></b><b><span style="font-family: 宋体; font-size: 18pt;"></span></b>
            </p>
			
			<tr>
            <!--日期-->
                <table class="MsoTableGrid01" border="0" cellspacing="0" style="border-collapse: collapse; width:100%;margin:0 auto;">
                    <tbody>
                        <tr>
                            <td style="width: 91px;">委托方（甲）:</td>
                            <td colspan="3" scope="col">昆明聚源达彩印包装有限公司</td>
                            <td>加工方（乙）：</td>
                            <td style="width: 91px;" colspan="4" scope="col"><%=myws %></td>
                        </tr>
                        <tr>
                            <td style="width: 91px;">电&nbsp;&nbsp;&nbsp;话:</td>
                            <td colspan="3" scope="col">0871-63849573</td>
                            <td style="width: 91px;">电&nbsp;&nbsp;&nbsp;话：</td>
                            <td colspan="4" scope="col"><%=nametle %></td>
                        </tr>
                        <tr>
                            <td style="width: 91px;">联系人:</td>
                            <td colspan="3" scope="col"><%=myxd %></td>
                            <td style="width: 91px;">联系人：</td>
                            <td colspan="4" scope="col"><%=ai %></td>
                        </tr>
                        <tr>
                            <td style="width: 91px;">地&nbsp;&nbsp;&nbsp;址:</td>
                            <td colspan="3" scope="col">昆明市寺瓦路省一监金马仓库</td>
                            <td style="width: 91px;">地&nbsp;&nbsp;&nbsp;址：</td>
                            <td colspan="4" scope="col"><%=address %></td>
                        </tr>
                        <tr>
                            <td style="width: 91px;">交货时间:</td>
                            <%if(myjhrq == null){%>
					
					<%}else{%>
					
                    <%if (!string.IsNullOrEmpty(myjhrq))
                        {%>
                            <td colspan="3" scope="col"><%=DateTime.Parse(myjhrq).ToString("yyyy-MM-dd") %></td>
                             <%}else{%>
                    <td colspan="3" scope="col"><%=myjhrq%></td>
                    <%} %>




                            <td style="width: 91px;">发外时间：</td>
                            <%if(myxdrq == null){%>
					
					<%}else{%>
					<%if (!string.IsNullOrEmpty(myxdrq)){%>
                            <td colspan="4" scope="col"><%=DateTime.Parse(myxdrq).ToString("yyyy-MM-dd")%></td>

                            <%} %>
					<%}%>
                            <%}%>
                        </tr>
                    </tbody>
                </table>
			


            <div align="center">
                <table class="MsoTableGrid" border="1" cellspacing="0" style="border-collapse: collapse; width:100%;">
                    <tbody>
                        <!--首行名称-->
                        <tr>
                            <td width="90" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">印刷品名</span>
                                </p>
                            </td>
                            <td width="98" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">接件单号</span>
                                </p>
                            </td>
                           
                            <td width="39" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">加工尺寸</span>
                                </p>
                            </td>
                             <td width="48" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">加工数量</span>
                                </p>
                            </td>
                            
                            <td width="64" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                   <span style="font-family: 微软雅黑; font-size: 13.9px;">单价</span>
                                </p>
                            </td>
                            <td width="44" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">金额</span>
                                </p>
                            </td>
                             <%--<td width="44" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">已付金额</span>
                                </p>
                            </td>--%>
                            
                        </tr>
                        <!--数值-->

                         <%foreach (DataRow dr in dt.Rows)
                             { %>
                        <tr>
                             <td width="90" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=yspmco %></span>
                                </p>
                            </td>
                            <td width="98" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=orderid %></span>
                                </p>
                            </td>
                           
                            <td width="39" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=mycc %></span>
                                </p>
                            </td>
                             <td width="48" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                   <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=mynum %></span>
                                </p>
                            </td>
                           
                            <td width="64" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=mydj %></span>
                                </p>
                            </td>
                           <td width="44" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                   <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=myysf %></span>
                                </p>
                            </td>
                            <%-- <td width="44" valign="center" style="font-family: 微软雅黑; font-size: 13.9px;">
                                <p class="MsoNormal" align="center" style="text-align: center;">
                                   <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=je %></span>
                                </p>
                            </td>--%>
                           
                        </tr>
                        <!--工艺-->
                       <%-- <tr>
                        </tr>--%>
                       <!--注释-->
                       
                         <%}%>

                       <!--合计-->
                        <tr>
                            <td width="618" valign="top" colspan="13.9" style="border: 1.0000pt solid windowtext;">

                                <p class="MsoNormal" align="justify" style="text-align: justify;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">金额：</span>
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;" id="daxje">
                                        <script>
                                            //这里用了两个方法,一个是数字转换为大写,一个HTML中应用js值
                                            var vv = "<%=myysf %>";
                                            var cc = cmycurd(vv);
                                            
                                            window.onload = function() {
			                                    document.getElementById("daxje").innerHTML = cc;
		                                    };
                                        </script>
                                        
                                    </span>
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"></span>
                                </p>
                               
                                <p class="MsoNormal" align="justify" style="text-align: justify;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">加工项目：</span>
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=myzzxm %></span>
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"></span>
                                </p>
                                <p class="MsoNormal" align="justify" style="text-align: justify;">
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;">加工备注：</span>
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"><%=wsjgbz %></span>
                                    <span style="font-family: 微软雅黑; font-size: 13.9px;"></span>
                                </p>
                            </td>
                        </tr>
                       
                        
                    </tbody>
                </table>
            </div>
        </div>
        <p class="MsoNormal">
               <span style="font-family: Calibri; font-size: 10.5000pt;">&nbsp;一、乙方按照甲方提供的样稿及工艺要求制作，保证质量准时交货</span><br />
                <span style="font-family: Calibri; font-size: 10.5000pt;">&nbsp;二、乙方一定要保证甲方的产品不泄密，不外流。如因泄密或外流造成的一切连带责任由乙方承担。加工时产生的残次品如实数返回给甲方。</span><br />
                <span style="font-family: Calibri; font-size: 10.5000pt;">&nbsp;三、如因乙方未按时交货或加工质量问题，造成客户的不收货或扣款，由乙方承担</span><br />
                <br /><br />
                <table class="MsoTableGrid01" border="0" cellspacing="0" style="border-collapse: collapse; width:100%;margin:0 auto;">
                    <tbody>
                        <tr>
                            <td style="width: 125px;">甲方签名（盖章）:</td>
                            <td colspan="3" scope="col">
                            <%if (manager == "1")
                                {%>
                            昆明聚源达彩印包装有限公司
                            <%} %>
                                </td>
                            <td style="width: 125px;">乙方签名（盖章）：</td>
                            <td colspan="4" scope="col"><%=myws %></td>
                        </tr>
                        
                        <tr>
                            <td style="width: 125px;">日&nbsp;&nbsp;&nbsp;期:</td>
                            <td colspan="3" scope="col"><%=DateTime.Now.ToString("yyyy年MM月dd日") %></td>
                            <td style="width: 125px;">日&nbsp;&nbsp;&nbsp;期：</td>
                            <td colspan="4" scope="col"><%=DateTime.Now.ToString("yyyy年MM月dd日") %></td>
                        </tr>
                        
                    </tbody>
                    
                </table>
           <p><img class="hhh" src="<%=qrcode %>"/> </p>
            </p>
            
		</td>
                            <td align="middle"></td>
                        </tr>
		</table>
    </form>
</body>
</html>
